//
//  QuestionAnswerApi.m
//  SeaMelonSeeds_Counselor
//
//  Created by 尤振宇 on 2017/7/26.
//  Copyright © 2017年 杨笑. All rights reserved.
//

#import "QuestionAnswerApi.h"

@implementation QuestionAnswerApi
{
    NSString *_requestUrl;
    NSDictionary *_requestArgument;
}

-(instancetype)init_TalkLists
{
    self = [super init];
    if (self) {
        _requestUrl = @"talk/lists";
        _requestArgument = @{@"page":@(self.page),};
    }
    return self;
}

-(instancetype)init_TalkReplys:(int)taldID
{
    self = [super init];
    if (self) {
        _requestUrl = @"talk/replys";
        _requestArgument = @{@"page":@(self.page),@"talk_id":@(taldID)};
    }
    return self;
}

-(instancetype)init_TalkReply:(NSString *)content talkID:(int)taldID
{
    self = [super init];
    if (self) {
        _requestUrl = @"talk/reply";
        _requestArgument = @{@"body":content,@"talk_id":@(taldID)};
    }
    return self;
}

-(void)setPage:(int)page
{
    [super setPage:page];
    if ([_requestArgument objectForKey:@"page"]) {
        NSMutableDictionary *dic = [[NSMutableDictionary alloc]initWithDictionary:_requestArgument];
        [dic setObject:@(page) forKey:@"page"];
        _requestArgument = dic;
    }
}
-(void)setTalkType:(int)talkType{
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:_requestArgument];
    [dict setObject:@(talkType) forKey:@"type"];
    _requestArgument = dict;
}

-(NSString *)requestUrl
{
    return _requestUrl;
}

-(id)requestArgument
{
    return _requestArgument;
}
@end
